package com.example.hzq.zqb.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.example.hzq.zqb.R;

/**
 * Created by hzq on 2017/7/12.
 */

public class MakemoneyActivity extends AppCompatActivity  implements View.OnClickListener{
    private ImageButton back;
    private TextView top;
    private LinearLayout shop,visit,raise,aim;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.makemoney);
        back=(ImageButton)findViewById(R.id.back1);
        top=(TextView)findViewById(R.id.toptext);
        shop=(LinearLayout)findViewById(R.id.mk_shop);
        visit=(LinearLayout)findViewById(R.id.mk_visit);
        raise=(LinearLayout)findViewById(R.id.mk_raise);
        aim=(LinearLayout)findViewById(R.id.mk_aim);
        top.setText("设置我的攒钱目标");
        back.setOnClickListener(this);
        shop.setOnClickListener(this);
        visit.setOnClickListener(this);
        raise.setOnClickListener(this);
        aim.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        Intent intent=new Intent();
        intent.setClass(MakemoneyActivity.this,MychoiceAcitivity.class);
        switch (v.getId()){
            case R.id.back1:
                finish();
                break;
            case R.id.mk_shop:
                intent.putExtra("num",0);
                startActivity(intent);
                break;
            case R.id.mk_visit:
                intent.putExtra("num",1);
                startActivity(intent);
                break;
            case R.id.mk_raise:
                intent.putExtra("num",2);
                startActivity(intent);
                break;
            case R.id.mk_aim:
                intent.putExtra("num",3);
                startActivity(intent);
                break;
        }
    }
}
